import React from 'react';
import { Tooltip } from 'antd';

import styles from './style.less';
interface Props {
  title: string;
  id?: string;
  icon?: any;
  tip?: string;
  style?: React.CSSProperties;
}

const CommonTitle: React.FC<Props> = (props) => {
  const { title = '', id, icon = null, tip = '', style = {} } = props;

  return (
    <div className={styles.box} id={id} style={style}>
      <div className={styles.title}>{title}</div>
      <Tooltip title={tip} color={'#be0915'} key={'gold'} placement="right">
        {icon && icon}
      </Tooltip>
    </div>
  );
};

export default CommonTitle;
